<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='ttbl' /></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>
<div class="layui-container">
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

        <form:form commandName="afterSale" class="layui-form" id="form">

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='thsp' /></legend>
            </fieldset>

            <table class="layui-table">
                <thead >
                <th style="border-color: black;"><fmt:message key='sptp' /></th>
                <th style="border-color: black;"><fmt:message key='spmc' /></th>
                <th style="border-color: black;"><fmt:message key='dj' /></th>
                <th style="border-color: black;"><fmt:message key='hh' /></th>
                <th style="border-color: black;"><fmt:message key='spsku' /></th>
                <th style="border-color: black;"><fmt:message key='sl' /></th>
                <th style="border-color: black;"><fmt:message key='xiaoj' /></th>
                </thead>
                <tbody>
                <c:forEach items="${afterSale.order.details}" var="detail">

                    <tr>
                        <td style="border-color: black;"><img class="preview" style="width:40px;" src="${store_domain}/uploads/${detail.defaultImage}"/></td>
                        <td style="border-color: black;">${detail.goodsName}</td>
                        <td style="border-color: black;"><fmt:formatNumber value="${detail.sku.price}" type="CURRENCY"/></td>
                        <td style="border-color: black;">${detail.productNo}</td>
                        <td style="border-color: black;">${detail.specs}</td>
                        <td style="border-color: black;">${detail.quantity}</td>
                        <td style="border-color: black;"><fmt:formatNumber value="${detail.price}" type="CURRENCY"/></td>
                    </tr>
                </c:forEach>
                <tr>
                    <td colspan="8" style="text-align: right;border-color: black;"><b style="color:red;"><fmt:message key='hj' />：<fmt:formatNumber value="${afterSale.refundPrice}" type="CURRENCY"/></b>
                        <c:if test="${afterSale.applyOfOrderStatus == 2}">
                        &nbsp;&nbsp;<fmt:message key='hyf' />（<fmt:formatNumber value="${afterSale.order.freightPrice}" type="CURRENCY"/>）</td>
                    </c:if>
                </tr>
                </tbody>
            </table>

            <c:if test="${afterSale.order.marketingType == 1}">

                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                    <legend><fmt:message key='zpqd' /></legend>
                </fieldset>

                <table class="layui-table">
                    <thead>
                    <th style="border-color: black;"><fmt:message key='sptp' /></th>
                    <th style="border-color: black;"><fmt:message key='spmc' /></th>
                    <th style="border-color: black;"><fmt:message key='spbh' /></th>
                    </thead>
                    <tbody>
                    <c:forEach items="${giftgoodses}" var="goods">
                        <tr>
                            <td style="border-color: black;"><img class="preview" style="width:40px;" src="${store_domain}/uploads/${goods.defaultImage}"/></td>
                            <td style="border-color: black;">${goods.name}</td>
                            <td style="border-color: black;">${goods.goodsNo}</td>
                        </tr>
                    </c:forEach>
                    <tr>
                        <td colspan="8" style="text-align: right;border-color: black;"><b style="color:red;">合计：<fmt:formatNumber value="${order.price}" type="CURRENCY"/></b>&nbsp;&nbsp;<fmt:message key='hyf' />（<fmt:formatNumber value="${order.freightPrice}" type="CURRENCY"/>）</td>
                    </tr>
                    </tbody>
                </table>

            </c:if>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='thxx' /></legend>
            </fieldset>

            <table class="layui-table" >
                <tbody>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='tkzt' /></td>
                    <td width="70%" style="border-color: black;" >
                        <c:choose>
                            <c:when test="${afterSale.status eq 1}"><fmt:message key='sqz' /></c:when>
                            <c:when test="${afterSale.status eq 2}"><fmt:message key='tkcg' /></c:when>
                            <c:when test="${afterSale.status eq 3}"><fmt:message key='tksb' /></c:when>
                        </c:choose>
                    </td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='shouhzt' /></td>
                    <td width="70%" style="border-color: black;" >
                        <c:choose>
                            <c:when test="${afterSale.checkStatus eq 1}"><fmt:message key='sqz' /></c:when>
                            <c:when test="${afterSale.checkStatus eq 2}"><fmt:message key='shtgdmjjh' /></c:when>
                            <c:when test="${afterSale.checkStatus eq 3}"><fmt:message key='shbtg' /></c:when>
                            <c:when test="${afterSale.checkStatus eq 4}"><fmt:message key='mjyjhdsjqs' /></c:when>
                            <c:when test="${afterSale.checkStatus eq 5}"><fmt:message key='sjyqs' /></c:when>
                            <c:when test="${afterSale.checkStatus eq 6}"><fmt:message key='ytkddwj' /></c:when>
                            <c:when test="${afterSale.checkStatus eq 7}"><fmt:message key='sjjjtk' /></c:when>
                        </c:choose>
                    </td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='ddbh' /></td>
                    <td width="70%" style="border-color: black;" >${afterSale.order.orderNo}</td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='shenqsj' /></td>
                    <td width="70%" style="border-color: black;" ><fmt:formatDate value="${afterSale.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='shrxm' /></td>
                    <td width="70%" style="border-color: black;" >${afterSale.order.deliveryName}</td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='shrdh' /></td>
                    <td width="70%" style="border-color: black;" >${afterSale.order.deliveryMobile}</td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" >发货状态</td>
                    <td width="70%" style="border-color: black;" >
                        <c:choose>
                            <c:when test="${afterSale.order.status eq 1}"><fmt:message key='tjdddfk' /></c:when>
                            <c:when test="${afterSale.order.status eq 2}"><fmt:message key='fkcgdfh' /></c:when>
                            <c:when test="${afterSale.order.status eq 3}"><fmt:message key='spckdsh' /></c:when>
                            <c:when test="${afterSale.order.status eq 4}"><fmt:message key='ddqsdpj' /></c:when>
                            <c:when test="${afterSale.order.status eq 5}"><fmt:message key='jywc' /></c:when>
                            <c:when test="${afterSale.order.status eq 6}"><fmt:message key='ddqx' /></c:when>
                        </c:choose>
                    </td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='tkje' /></td>
                    <td width="70%" style="border-color: black;" ><fmt:formatNumber value="${afterSale.refundPrice}" type="CURRENCY"/></td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='thyy' /></td>
                    <td width="70%" style="border-color: black;" >${afterSale.afterSaleReason}</td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='wtms' /></td>
                    <td width="70%" style="border-color: black;" >${afterSale.note}</td>
                </tr>
                <tr>
                    <td width="20%" style="background-color:#eaeaea;border-color: black;" ><fmt:message key='pzzp' /></td>
                    <td width="70%" style="border-color: black;" >
                        <c:forEach items="${afterSale.images}" var="image">
                            <img src="${store_domain}/uploads/${image.name}" style="width:60px;height:60px;" class="preview" />
                        </c:forEach>
                    </td>
                </tr>


                </tbody>
            </table>

        </form:form>
    </div>
</div>

<script>

    $(function () {

        layui.use(['form', 'laydate'], function () {

            var form = layui.form;
            var laydate = layui.laydate;

        });

    });
</script>
</body>
</fmt:bundle>
</html>